package com.scau.service.impl;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.scau.dao.IPaymentDao;
import com.scau.service.IPaymentService;
import com.scau.util.DateTransform;
import com.scau.vo.Payment;

/**
 * @author Jinglun
 * @create 2017年4月22日
 */
public class PaymentServiceImpl implements IPaymentService {

	private IPaymentDao paymentDao;
	
	@Override
	public boolean savePayment(Payment payment) {
		// 当前时间由Date->Timestamp
		Date date = new Date();
		DateTransform dt = new DateTransform();
		Timestamp create = dt.dToTimestamp(date);
		payment.setPayDateTime(create);
		return paymentDao.savePayment(payment);
	}

	@Override
	public List<Payment> listPayment() {
		return paymentDao.listPayment();
	}

	// get,set methods
	public IPaymentDao getPaymentDao() {
		return paymentDao;
	}

	public void setPaymentDao(IPaymentDao paymentDao) {
		this.paymentDao = paymentDao;
	}

}
